/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.login.plugin.register.rapid;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.login.plugin.d;
import com.qihoo.gamecenter.sdk.login.plugin.d.a;
import com.qihoo.gamecenter.sdk.login.plugin.f.a;
import com.qihoo.gamecenter.sdk.login.plugin.h.c;
import com.qihoo.gamecenter.sdk.login.plugin.h.f;

public class RegisterTitleBar extends FrameLayout {
    private Activity a;
    private a b;
    private RegisterMainLayout.b c;
    private TextView d;
    private String e;
    private a f;

    public RegisterTitleBar(Context paramContext, String paramString) {
        super(paramContext);
        this.a = ((Activity) paramContext);
        this.e = paramString;
        this.f = a.a(this.a);
        a();
        b();
    }

    public RegisterTitleBar(Context paramContext, AttributeSet paramAttributeSet) {
        super(paramContext, paramAttributeSet);
    }

    public void setOperationListener(RegisterMainLayout.b paramb) {
        this.c = paramb;
    }

    public void setTitle(d.a parama) {
        LinearLayout.LayoutParams localLayoutParams;
        if (parama == d.a.B) {
            localLayoutParams = new LinearLayout.LayoutParams(-2, -2);
            this.d.setLayoutParams(localLayoutParams);
            this.d.setTextColor(Color.parseColor("#ff7f16"));
            this.d.setTextSize(1, c.g);
            this.d.getPaint().setFakeBoldText(true);
            this.d.setText(d.a(d.a.dW));
        }
        else {
            localLayoutParams = new LinearLayout.LayoutParams(-2, -2);
            this.f.a(this.d, 0);
            this.d.setText(d.a(parama));
            this.d.setLayoutParams(localLayoutParams);
        }
    }

    private void a() {
        this.b = a.a(this.a);
    }

    private void b() {
        FrameLayout localFrameLayout = new FrameLayout(this.a);
        FrameLayout.LayoutParams localLayoutParams1 = new FrameLayout.LayoutParams(-2, -2);
        localLayoutParams1.gravity = 16;
        addView(localFrameLayout, localLayoutParams1);
        localFrameLayout.setPadding(f.a(this.a, 12.0F), 0, 0, 0);
        ImageView localImageView = new ImageView(this.a);
        int i = f.a(this.a, 4.0F);
        localImageView.setPadding(i, i, i, i);
        localImageView.setScaleType(ImageView.ScaleType.FIT_XY);
        this.b.a(localImageView, 1073741877, 1073741878, 0);
        FrameLayout.LayoutParams localLayoutParams2 = new FrameLayout.LayoutParams(f.a(this.a, 34.0F), f.a(this.a,
                34.0F));
        localLayoutParams2.gravity = 17;
        localFrameLayout.addView(localImageView, localLayoutParams2);
        localImageView.setOnClickListener(new View.OnClickListener() {
            public void onClick(View paramView) {
                if (RegisterTitleBar.a(RegisterTitleBar.this) == null)
                    return;
                RegisterTitleBar.a(RegisterTitleBar.this).a("to_back_by_titlebar", "", null);
            }
        });
        LinearLayout localLinearLayout = new LinearLayout(this.a);
        FrameLayout.LayoutParams localLayoutParams3 = new FrameLayout.LayoutParams(-1, -2);
        localLayoutParams3.gravity = 17;
        localLinearLayout.setLayoutParams(localLayoutParams3);
        localLinearLayout.setGravity(17);
        TextView localTextView = new TextView(this.a);
        localTextView.setGravity(17);
        this.d = localTextView;
        localLinearLayout.addView(localTextView);
        setTitle(d.a.B);
        FrameLayout.LayoutParams localLayoutParams4 = new FrameLayout.LayoutParams(-2, f.a(this.a, 45.0F));
        localLayoutParams4.gravity = 17;
        addView(localLinearLayout, localLayoutParams4);
    }
}